gtkbindings: Clarify that widgets need has-focus for bindings to work
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 22 Aug 2016 16:10:47 +0000 (17:10 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Mon, 22 Aug 2016 17:06:39 +0000 (18:06 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=770242

gtk/gtkbindings.c

index 54515d3e0deeb6930a48a5682abd59b31914f3ca..f71fcac335c65ac93b0ad3d6b2bb46ea3661f9a2 100644 (file)
  * with high key  binding configurability which requires no application
  * or toolkit side changes.
  *
+ * In order for bindings to work in a custom widget implementation, the
+ * widget’s #GtkWidget:can-focus and #GtkWidget:has-focus properties
+ * must both be true. For example, by calling gtk_widget_set_can_focus()
+ * in the widget’s initialisation function; and by calling
+ * gtk_widget_grab_focus() when the widget is clicked.
+ *
  * # Installing a key binding
  *
  * A CSS file binding consists of a “binding-set” definition and a match